package com.liner.test;

public class StaticFinalDemo {
    public static void main(String[] args) {
        System.out.println(StaticFinal.TEST_);
        System.out.println(StaticFinal.PI);

        //编译器在编译时会将常量直接替换成具体的数，效率更高
        System.out.println(StaticFinal.COUNT);

        //加载 StaticFinal.class到方法区
        //静态变量num一并存储到方法区
        //到方法区中获取num的值并输出
        System.out.println(StaticFinal.num);


    }

}

class StaticFinal {

    public static final int COUNT = 5;
    public static  int num = 5;



    public static final double PI = 3.14159265;

    public static final String TEST_ = "static final";

}